package top.ieei.demo.tftp;

/**
 * TFTP异常封装<br>
 * @author xiecongshu
 */
public class TftpException extends Exception
{
    
    /**
     * serial Version UID
     */
    private static final long serialVersionUID = -6728326564051857160L;
    
    /**
     * 错误码
     */
    private long errorCode = 0L;
    
    /**
     * 错误描述信息
     */
    private String errorMessage = "TFTP ERROR.";
    
    /**
     * <默认构造函数>
     */
    public TftpException()
    {
        super();
    }
    
    /**
     * <默认构造函数>
     */
    public TftpException(Throwable throwable)
    {
        super(throwable);
        this.errorMessage = throwable.getMessage();
    }
    
    /**
     * <默认构造函数>
     */
    public TftpException(String errorMessage)
    {
        super(errorMessage);
        this.errorMessage = errorMessage;
    }
    
    /**
     * <默认构造函数>
     */
    public TftpException(long errorCode, String errorMessage)
    {
        super(errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }
    
    /**
     * <默认构造函数>
     */
    public TftpException(String errorMessage, Throwable throwable)
    {
        super(errorMessage, throwable);
        this.errorMessage = errorMessage;
    }
    
    /**
     * <默认构造函数>
     */
    public TftpException(long errorCode, String errorMessage,
            Throwable throwable)
    {
        super(errorMessage, throwable);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }
    
    /**
     * @return 返回 errorCode
     */
    public long getErrorCode()
    {
        return errorCode;
    }
    
    /**
     * @param 对errorCode进行赋值
     */
    public void setErrorCode(long errorCode)
    {
        this.errorCode = errorCode;
    }
    
    /**
     * @return 返回 errorMessage
     */
    public String getErrorMessage()
    {
        return errorMessage;
    }
    
    /**
     * @param 对errorMessage进行赋值
     */
    public void setErrorMessage(String errorMessage)
    {
        this.errorMessage = errorMessage;
    }
}
